<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-3.1.1.js"></script>
</head>
<body>
<input type="button" id="xx" value="click">
<div>
    <iframe id="in" src="test2.html" width="500" height="200" frameborder="1"></iframe>
</div>

<script>


    $("#xx").click(function() {
        show();
    });
    function show() {
        //alert(document.getElementById("in").contentWindow.document.body.innerHTML);
        $("#xx").val("haha");
    }
</script>
</body>
</html>